<?php

/**
 * Follower form base class.
 *
 * @method Follower getObject() Returns the current form's model object
 *
 * @package    truetrader
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseFollowerForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'follower_id'        => new sfWidgetFormInputHidden(),
      'trader_id'          => new sfWidgetFormInputHidden(),
      'follower_statut_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FollowerStatut'), 'add_empty' => false)),
      'is_suspend'         => new sfWidgetFormInputCheckbox(),
      'priority'           => new sfWidgetFormInputText(),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'follower_id'        => new sfValidatorChoice(array('choices' => array($this->getObject()->get('follower_id')), 'empty_value' => $this->getObject()->get('follower_id'), 'required' => false)),
      'trader_id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('trader_id')), 'empty_value' => $this->getObject()->get('trader_id'), 'required' => false)),
      'follower_statut_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FollowerStatut'))),
      'is_suspend'         => new sfValidatorBoolean(array('required' => false)),
      'priority'           => new sfValidatorInteger(array('required' => false)),
      'created_at'         => new sfValidatorDateTime(),
      'updated_at'         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('follower[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Follower';
  }

}
